package com.ln.dm1107.demo01;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/7 15:46
 */
public class Test03 {
    public static void main(String[] args) {
//        LocalDateTime now = LocalDateTime.now();
//        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
//        String format = now.format(dateTimeFormatter);
//        System.out.println(format);

        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
        LocalDateTime parse = LocalDateTime.parse("2020/11/17 22:22:22",dateTimeFormatter);
//        LocalDateTime dateTime = LocalDateTime.parse("2020/11/17 22:22:22", dateTimeFormatter);
        System.out.println(parse);
    }
}
